<div class="row">
  <div class="col-sm-12 col-md-12 col-sm-offset-1  col-md-offset-1">
    <div class="page-header">
        <h2>Policy {{selectedPolicy}}</h2>
    </div>
  </div>
</div>



<div class="row">
  <div class="col-sm-12 col-md-12 col-sm-offset-1  col-md-offset-1">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title" ng-if="policyDetails.length == 0">
              Pending... Thank you for your patience!
          </h3>
          <h3 class="panel-title" ng-if="policyDetails.length > 0 && policyDetails[0].args.delay == 0">
              Flight Departed on time.
          </h3>
           <h3 class="panel-title" ng-if="policyDetails.length > 0 && policyDetails[0].args.delay == 1">
              Flight is delayed for more than 30 minutes.
          </h3>
            <h3 class="panel-title" ng-if="policyDetails.length > 0 && policyDetails[0].args.delay == 2">
              Flight is cancelled.
          </h3>
             <h3 class="panel-title" ng-if="policyDetails.length > 0 && policyDetails[0].args.delay == 3">
              Flight has not departed.
          </h3>
          <h3 class="panel-title" ng-if="policyDetails.length > 0 && policyDetails[0].args.delay == 4">
              Flight is not found.
          </h3>
        </div>
        <div class="panel-body">
          <table ng-if="policyDetails.length > 0" class="table">
            <tr>
              <th>Transaction</th>
              <th>Receipt</th>
            </tr>
            <tr ng-repeat="event in policyDetails">
              <td ng-if="event.args.delay == 0">Paid Big Red {{event.args.payeeBalance}} ETH for premium.</td>
              <td ng-if="event.args.delay == 1">Received compensation of 5x{{event.args.payeeBalance}} ETH from Big Red.</td>
              <td ng-if="event.args.delay == 2">Received compensation of 5x{{event.args.payeeBalance}} ETH from Big Red.</td>
              <td ng-if="event.args.delay == 3">Partially refunded {{event.args.payeeBalance}} ETH by Big Red.</td>
              <td ng-if="event.args.delay == 4">Partially refunded {{event.args.payeeBalance}} ETH by Big Red.</td>
              <td>{{event.transactionHash}}</td>
            </tr>
            <tr>
            </tr>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="row">
  <div class="col-sm-12 col-md-12 col-sm-offset-1  col-md-offset-1">
  	<button class="pull-right" type="button" ui-sref="check.list">Back</button>
  </div>
 </div>
